package com.dragon.modules.yuegou.query.message;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.message.TemplateEntity;
import com.dragon.modules.yuegou.enums.MsgType;
import com.dragon.modules.yuegou.enums.message.TemplateStatus;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 消息模板 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-07-17 19:56:06
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class TemplateQuery extends TemplateEntity implements Query<TemplateEntity> {

	private static final long serialVersionUID = 1L;


    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 模板名称查询条件 */
	@JsonUnwrapped(prefix = "name")
	private Condition<String> nameCondition;

    /** 模板标题（可配置模板参数）查询条件 */
	@JsonUnwrapped(prefix = "title")
	private Condition<String> titleCondition;

    /** 模板内容查询条件 */
	@JsonUnwrapped(prefix = "content")
	private Condition<String> contentCondition;

    /** 连接地址（可配模板参数）查询条件 */
	@JsonUnwrapped(prefix = "url")
	private Condition<String> urlCondition;

    /** 参数个数查询条件 */
	@JsonUnwrapped(prefix = "argNum")
	private Condition<Integer> argNumCondition;

    /** [枚举]状态：0-暂存-TEMP、1-已启用-ENABLED、2-禁用-DISABLED查询条件 */
	@JsonUnwrapped(prefix = "status")
	private Condition<TemplateStatus> statusCondition;

    /** [全局枚举]消息类型：0-文本消息-TEXT、1-语音消息-VOICE、2-APP消息-APP、3-HTML消息-HTML查询条件 */
	@JsonUnwrapped(prefix = "msgType")
	private Condition<MsgType> msgTypeCondition;

    /** 创建人ID查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 更新人ID查询条件 */
	@JsonUnwrapped(prefix = "modifiedBy")
	private Condition<String> modifiedByCondition;

    /** 更新时间查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

    /** 是否删除查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 删除人ID查询条件 */
	@JsonUnwrapped(prefix = "delBy")
	private Condition<String> delByCondition;

    /** 删除时间查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

    /** 腾讯云短信模板ID查询条件 */
	@JsonUnwrapped(prefix = "tencentsmsTemplateId")
	private Condition<Integer> tencentsmsTemplateIdCondition;

    /** 微信公众号模板ID查询条件 */
	@JsonUnwrapped(prefix = "wechatTemplateId")
	private Condition<String> wechatTemplateIdCondition;

    /** 微信公众号模板参数查询条件 */
	@JsonUnwrapped(prefix = "wechatTemplateArgs")
	private Condition<String> wechatTemplateArgsCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public TemplateQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public TemplateQuery(TemplateEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public TemplateQuery(TemplateQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.nameCondition != null) {
			this.nameCondition = other.nameCondition.copy();
		}
		if(other.titleCondition != null) {
			this.titleCondition = other.titleCondition.copy();
		}
		if(other.contentCondition != null) {
			this.contentCondition = other.contentCondition.copy();
		}
		if(other.urlCondition != null) {
			this.urlCondition = other.urlCondition.copy();
		}
		if(other.argNumCondition != null) {
			this.argNumCondition = other.argNumCondition.copy();
		}
		if(other.statusCondition != null) {
			this.statusCondition = other.statusCondition.copy();
		}
		if(other.msgTypeCondition != null) {
			this.msgTypeCondition = other.msgTypeCondition.copy();
		}
		if(other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.modifiedByCondition != null) {
			this.modifiedByCondition = other.modifiedByCondition.copy();
		}
		if(other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delByCondition != null) {
			this.delByCondition = other.delByCondition.copy();
		}
		this.setOther(other);
	}
	private void setOther(TemplateQuery other){
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
		if(other.tencentsmsTemplateIdCondition != null) {
			this.tencentsmsTemplateIdCondition = other.tencentsmsTemplateIdCondition.copy();
		}
		if(other.wechatTemplateIdCondition != null) {
			this.wechatTemplateIdCondition = other.wechatTemplateIdCondition.copy();
		}
		if(other.wechatTemplateArgsCondition != null) {
			this.wechatTemplateArgsCondition = other.wechatTemplateArgsCondition.copy();
		}
	}

	@Override
	public QueryWrapper<TemplateEntity> toQueryWrapper() {
		QueryWrapper<TemplateEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (nameCondition != null) {
			nameCondition.toWrapper(wrapper, COL_NAME);
		}
		if (titleCondition != null) {
			titleCondition.toWrapper(wrapper, COL_TITLE);
		}
		if (contentCondition != null) {
			contentCondition.toWrapper(wrapper, COL_CONTENT);
		}
		if (urlCondition != null) {
			urlCondition.toWrapper(wrapper, COL_URL);
		}
		if (argNumCondition != null) {
			argNumCondition.toWrapper(wrapper, COL_ARG_NUM);
		}
		if (statusCondition != null) {
			statusCondition.toWrapper(wrapper, COL_STATUS);
		}
		if (msgTypeCondition != null) {
			msgTypeCondition.toWrapper(wrapper, COL_MSG_TYPE);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (modifiedByCondition != null) {
			modifiedByCondition.toWrapper(wrapper, COL_MODIFIED_BY);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delByCondition != null) {
			delByCondition.toWrapper(wrapper, COL_DEL_BY);
		}
		return getQueryWrapper(wrapper);
	}

	private QueryWrapper<TemplateEntity> getQueryWrapper(QueryWrapper<TemplateEntity> wrapper){
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		if (tencentsmsTemplateIdCondition != null) {
			tencentsmsTemplateIdCondition.toWrapper(wrapper, COL_TENCENTSMS_TEMPLATE_ID);
		}
		if (wechatTemplateIdCondition != null) {
			wechatTemplateIdCondition.toWrapper(wrapper, COL_WECHAT_TEMPLATE_ID);
		}
		if (wechatTemplateArgsCondition != null) {
			wechatTemplateArgsCondition.toWrapper(wrapper, COL_WECHAT_TEMPLATE_ARGS);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回模板名称查询条件
	 * 
	 * @return nameCondition 模板名称查询条件
	 */
	public Condition<String> name() {
		this.nameCondition = new Condition<>();
		return this.nameCondition;
	}
	
	/**
	 * 获取模板名称查询条件
	 * 
	 * @return nameCondition 模板名称查询条件
	 */
	public Condition<String> getNameCondition() {
		return nameCondition;
	}

	/**
	 * 设置模板名称查询条件
	 * 
	 * @param nameCondition 模板名称查询条件
	 */
	public void setNameCondition(Condition<String> nameCondition) {
		this.nameCondition = nameCondition;
	}

	/**
	 * 构造并返回模板标题（可配置模板参数）查询条件
	 * 
	 * @return titleCondition 模板标题（可配置模板参数）查询条件
	 */
	public Condition<String> title() {
		this.titleCondition = new Condition<>();
		return this.titleCondition;
	}
	
	/**
	 * 获取模板标题（可配置模板参数）查询条件
	 * 
	 * @return titleCondition 模板标题（可配置模板参数）查询条件
	 */
	public Condition<String> getTitleCondition() {
		return titleCondition;
	}

	/**
	 * 设置模板标题（可配置模板参数）查询条件
	 * 
	 * @param titleCondition 模板标题（可配置模板参数）查询条件
	 */
	public void setTitleCondition(Condition<String> titleCondition) {
		this.titleCondition = titleCondition;
	}

	/**
	 * 构造并返回模板内容查询条件
	 * 
	 * @return contentCondition 模板内容查询条件
	 */
	public Condition<String> content() {
		this.contentCondition = new Condition<>();
		return this.contentCondition;
	}
	
	/**
	 * 获取模板内容查询条件
	 * 
	 * @return contentCondition 模板内容查询条件
	 */
	public Condition<String> getContentCondition() {
		return contentCondition;
	}

	/**
	 * 设置模板内容查询条件
	 * 
	 * @param contentCondition 模板内容查询条件
	 */
	public void setContentCondition(Condition<String> contentCondition) {
		this.contentCondition = contentCondition;
	}

	/**
	 * 构造并返回连接地址（可配模板参数）查询条件
	 * 
	 * @return urlCondition 连接地址（可配模板参数）查询条件
	 */
	public Condition<String> url() {
		this.urlCondition = new Condition<>();
		return this.urlCondition;
	}
	
	/**
	 * 获取连接地址（可配模板参数）查询条件
	 * 
	 * @return urlCondition 连接地址（可配模板参数）查询条件
	 */
	public Condition<String> getUrlCondition() {
		return urlCondition;
	}

	/**
	 * 设置连接地址（可配模板参数）查询条件
	 * 
	 * @param urlCondition 连接地址（可配模板参数）查询条件
	 */
	public void setUrlCondition(Condition<String> urlCondition) {
		this.urlCondition = urlCondition;
	}

	/**
	 * 构造并返回参数个数查询条件
	 * 
	 * @return argNumCondition 参数个数查询条件
	 */
	public Condition<Integer> argNum() {
		this.argNumCondition = new Condition<>();
		return this.argNumCondition;
	}
	
	/**
	 * 获取参数个数查询条件
	 * 
	 * @return argNumCondition 参数个数查询条件
	 */
	public Condition<Integer> getArgNumCondition() {
		return argNumCondition;
	}

	/**
	 * 设置参数个数查询条件
	 * 
	 * @param argNumCondition 参数个数查询条件
	 */
	public void setArgNumCondition(Condition<Integer> argNumCondition) {
		this.argNumCondition = argNumCondition;
	}

	/**
	 * 构造并返回[枚举]状态：0-暂存-TEMP、1-已启用-ENABLED、2-禁用-DISABLED查询条件
	 * 
	 * @return statusCondition [枚举]状态：0-暂存-TEMP、1-已启用-ENABLED、2-禁用-DISABLED查询条件
	 */
	public Condition<TemplateStatus> status() {
		this.statusCondition = new Condition<>();
		return this.statusCondition;
	}
	
	/**
	 * 获取[枚举]状态：0-暂存-TEMP、1-已启用-ENABLED、2-禁用-DISABLED查询条件
	 * 
	 * @return statusCondition [枚举]状态：0-暂存-TEMP、1-已启用-ENABLED、2-禁用-DISABLED查询条件
	 */
	public Condition<TemplateStatus> getStatusCondition() {
		return statusCondition;
	}

	/**
	 * 设置[枚举]状态：0-暂存-TEMP、1-已启用-ENABLED、2-禁用-DISABLED查询条件
	 * 
	 * @param statusCondition [枚举]状态：0-暂存-TEMP、1-已启用-ENABLED、2-禁用-DISABLED查询条件
	 */
	public void setStatusCondition(Condition<TemplateStatus> statusCondition) {
		this.statusCondition = statusCondition;
	}

	/**
	 * 构造并返回[全局枚举]消息类型：0-文本消息-TEXT、1-语音消息-VOICE、2-APP消息-APP、3-HTML消息-HTML查询条件
	 * 
	 * @return msgTypeCondition [全局枚举]消息类型：0-文本消息-TEXT、1-语音消息-VOICE、2-APP消息-APP、3-HTML消息-HTML查询条件
	 */
	public Condition<MsgType> msgType() {
		this.msgTypeCondition = new Condition<>();
		return this.msgTypeCondition;
	}
	
	/**
	 * 获取[全局枚举]消息类型：0-文本消息-TEXT、1-语音消息-VOICE、2-APP消息-APP、3-HTML消息-HTML查询条件
	 * 
	 * @return msgTypeCondition [全局枚举]消息类型：0-文本消息-TEXT、1-语音消息-VOICE、2-APP消息-APP、3-HTML消息-HTML查询条件
	 */
	public Condition<MsgType> getMsgTypeCondition() {
		return msgTypeCondition;
	}

	/**
	 * 设置[全局枚举]消息类型：0-文本消息-TEXT、1-语音消息-VOICE、2-APP消息-APP、3-HTML消息-HTML查询条件
	 * 
	 * @param msgTypeCondition [全局枚举]消息类型：0-文本消息-TEXT、1-语音消息-VOICE、2-APP消息-APP、3-HTML消息-HTML查询条件
	 */
	public void setMsgTypeCondition(Condition<MsgType> msgTypeCondition) {
		this.msgTypeCondition = msgTypeCondition;
	}

	/**
	 * 构造并返回创建人ID查询条件
	 * 
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取创建人ID查询条件
	 * 
	 * @return createdByCondition 创建人ID查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置创建人ID查询条件
	 * 
	 * @param createdByCondition 创建人ID查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回更新人ID查询条件
	 * 
	 * @return modifiedByCondition 更新人ID查询条件
	 */
	public Condition<String> modifiedBy() {
		this.modifiedByCondition = new Condition<>();
		return this.modifiedByCondition;
	}
	
	/**
	 * 获取更新人ID查询条件
	 * 
	 * @return modifiedByCondition 更新人ID查询条件
	 */
	public Condition<String> getModifiedByCondition() {
		return modifiedByCondition;
	}

	/**
	 * 设置更新人ID查询条件
	 * 
	 * @param modifiedByCondition 更新人ID查询条件
	 */
	public void setModifiedByCondition(Condition<String> modifiedByCondition) {
		this.modifiedByCondition = modifiedByCondition;
	}

	/**
	 * 构造并返回更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 更新时间查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取更新时间查询条件
	 * 
	 * @return modifiedTimeCondition 更新时间查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置更新时间查询条件
	 * 
	 * @param modifiedTimeCondition 更新时间查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

	/**
	 * 构造并返回是否删除查询条件
	 * 
	 * @return delCondition 是否删除查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取是否删除查询条件
	 * 
	 * @return delCondition 是否删除查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置是否删除查询条件
	 * 
	 * @param delCondition 是否删除查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回删除人ID查询条件
	 * 
	 * @return delByCondition 删除人ID查询条件
	 */
	public Condition<String> delBy() {
		this.delByCondition = new Condition<>();
		return this.delByCondition;
	}
	
	/**
	 * 获取删除人ID查询条件
	 * 
	 * @return delByCondition 删除人ID查询条件
	 */
	public Condition<String> getDelByCondition() {
		return delByCondition;
	}

	/**
	 * 设置删除人ID查询条件
	 * 
	 * @param delByCondition 删除人ID查询条件
	 */
	public void setDelByCondition(Condition<String> delByCondition) {
		this.delByCondition = delByCondition;
	}

	/**
	 * 构造并返回删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置删除时间查询条件
	 * 
	 * @param delTimeCondition 删除时间查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

	/**
	 * 构造并返回腾讯云短信模板ID查询条件
	 * 
	 * @return tencentsmsTemplateIdCondition 腾讯云短信模板ID查询条件
	 */
	public Condition<Integer> tencentsmsTemplateId() {
		this.tencentsmsTemplateIdCondition = new Condition<>();
		return this.tencentsmsTemplateIdCondition;
	}
	
	/**
	 * 获取腾讯云短信模板ID查询条件
	 * 
	 * @return tencentsmsTemplateIdCondition 腾讯云短信模板ID查询条件
	 */
	public Condition<Integer> getTencentsmsTemplateIdCondition() {
		return tencentsmsTemplateIdCondition;
	}

	/**
	 * 设置腾讯云短信模板ID查询条件
	 * 
	 * @param tencentsmsTemplateIdCondition 腾讯云短信模板ID查询条件
	 */
	public void setTencentsmsTemplateIdCondition(Condition<Integer> tencentsmsTemplateIdCondition) {
		this.tencentsmsTemplateIdCondition = tencentsmsTemplateIdCondition;
	}

	/**
	 * 构造并返回微信公众号模板ID查询条件
	 * 
	 * @return wechatTemplateIdCondition 微信公众号模板ID查询条件
	 */
	public Condition<String> wechatTemplateId() {
		this.wechatTemplateIdCondition = new Condition<>();
		return this.wechatTemplateIdCondition;
	}
	
	/**
	 * 获取微信公众号模板ID查询条件
	 * 
	 * @return wechatTemplateIdCondition 微信公众号模板ID查询条件
	 */
	public Condition<String> getWechatTemplateIdCondition() {
		return wechatTemplateIdCondition;
	}

	/**
	 * 设置微信公众号模板ID查询条件
	 * 
	 * @param wechatTemplateIdCondition 微信公众号模板ID查询条件
	 */
	public void setWechatTemplateIdCondition(Condition<String> wechatTemplateIdCondition) {
		this.wechatTemplateIdCondition = wechatTemplateIdCondition;
	}

	/**
	 * 构造并返回微信公众号模板参数查询条件
	 * 
	 * @return wechatTemplateArgsCondition 微信公众号模板参数查询条件
	 */
	public Condition<String> wechatTemplateArgs() {
		this.wechatTemplateArgsCondition = new Condition<>();
		return this.wechatTemplateArgsCondition;
	}
	
	/**
	 * 获取微信公众号模板参数查询条件
	 * 
	 * @return wechatTemplateArgsCondition 微信公众号模板参数查询条件
	 */
	public Condition<String> getWechatTemplateArgsCondition() {
		return wechatTemplateArgsCondition;
	}

	/**
	 * 设置微信公众号模板参数查询条件
	 * 
	 * @param wechatTemplateArgsCondition 微信公众号模板参数查询条件
	 */
	public void setWechatTemplateArgsCondition(Condition<String> wechatTemplateArgsCondition) {
		this.wechatTemplateArgsCondition = wechatTemplateArgsCondition;
	}

}
